#!/usr/bin/env python
# coding=utf-8
import pretty_errors
import urllib.request

# 3.1.1 发送请求
response = urllib.request.urlopen('http://www.baidu.com')
#print(response.read().decode('utf-8'))

print(type(response))  # 输出响应类型
print(response.status)  #状态码
print(response.getheaders())
print(response.getheader('Server'))
